[maas_non_provisioned]
{% for host in (maas_machines['stdout']|from_json) %}
{%   if groups['maas_deployed_machines'] is defined %}
{%     if host['fqdn'] not in groups['maas_deployed_machines'] %}
{{ host['fqdn'] }}
{%     elif host['hostname'] not in groups['maas_deployed_machines'] %}
{{ host['hostname'] }}
{%     endif %}
{%   elif groups['maas_deployed_machines'] is not defined %}
{{ host['fqdn'] }}
{{ host['hostname'] }}
{%   endif %}
{% endfor %}
{% if kvm_vms_list is defined %}
{%   if groups['maas_deployed_machines'] is defined %}
{%     for kvm_vm in kvm_vms_list %}
{%       if kvm_vm not in groups['maas_deployed_machines'] %}
{{ kvm_vm }}
{%       endif %}
{%     endfor %}
{%   elif groups['maas_deployed_machines'] is not defined %}
{%     for kvm_vm in kvm_vms_list %}
{{ kvm_vm }}
{%     endfor %}
{%   endif %}
{% endif %}
